package com.dingdang.controller.admin.admin;

import com.dingdang.model.AdminLeftNav;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 后台页面跳转控制类Gasstation
 */
@Controller
@RequestMapping("/admin/user")
public class UserViewController {

    //  管理后台登录后首页
    @RequestMapping("userIndex")
    public String index(Model model,int index,String openPage) {

        List<AdminLeftNav> allAdminLeftNav3 = new ArrayList<AdminLeftNav>(){{
                    add(new AdminLeftNav("用户列表", "userIndex?index=0&openPage=userCenterFirst",0));
                    add(new AdminLeftNav("车贴记录", "userIndex?index=1&openPage=userCarPhoto",0));
                    add(new AdminLeftNav("身份认证", "userIndex?index=2&openPage=check",0));
                    add(new AdminLeftNav("网约车认证", "userIndex?index=3&openPage=carTypeCheck",0));
                    add(new AdminLeftNav("银行卡认证", "userIndex?index=4&openPage=card",0));
                    add(new AdminLeftNav("提现审核", "userIndex?index=5&openPage=payCheck",0));
                    add(new AdminLeftNav("提现打款", "userIndex?index=6&openPage=pay",0));
                    add(new AdminLeftNav("邀请二维码", "userIndex?index=7&openPage=userQrcode",0));
                }};

        allAdminLeftNav3.get(index).setIsActive(1);
        model.addAttribute("adminLeftNav",allAdminLeftNav3);
        model.addAttribute("openPage", openPage);
        model.addAttribute("isHeadActive", 3);
        return "admin/userCenter";
    }

    @RequestMapping("userCenterFirst")
    public String orderCenterFirst() {
        return "admin/userList";
    }

    @RequestMapping("userCarPhoto")
    public String userCarPhoto() {
        return "admin/userCarPhoto";
    }

    @RequestMapping("check")
    public String check() {
        return "admin/check";
    }

    @RequestMapping("carTypeCheck")
    public String carTypeCheck() {
        return "admin/carTypeCheck";
    }

    @RequestMapping("card")
    public String card() {
        return "admin/card";
    }

    @RequestMapping("payCheck")
    public String payCheck() {
        return "admin/payCheck";
    }

    @RequestMapping("pay")
    public String pay() {
        return "admin/pay";
    }

    @RequestMapping("userQrcode")
    public String userQrcode() {
        return "admin/userQrcode";
    }
}
